﻿Imports Microsoft.TeamFoundation.Client
Imports Microsoft.Practices.Composite.Regions
Imports Microsoft.Practices.Composite.Events
Imports Microsoft.Practices.Composite.Wpf.Commands
Imports Hinshelwood.TFSStickyBuddy.Modules.Interfaces
Imports Hinshelwood.TFSStickyBuddy.Modules.Model
Imports Microsoft.Practices.Unity

Namespace Controllers


    Public Class TeamSystemController
        Implements ITeamSystemController

        Private ReadOnly m_regionManager As IRegionManager
        Private ReadOnly m_eventAggregator As IEventAggregator
        Private ReadOnly m_container As IUnityContainer
        Private Shared m_ConnectCommand As DelegateCommand(Of Uri)

        Public Sub New(ByVal regionManager As IRegionManager, ByVal container As IUnityContainer, ByVal eventAggregator As IEventAggregator)
            m_regionManager = regionManager
            m_eventAggregator = eventAggregator
            m_container = container
            m_ConnectCommand = New DelegateCommand(Of Uri)(AddressOf OnConnectExecuted)
        End Sub

        Public ReadOnly Property ConnectCommand() As DelegateCommand(Of Uri) Implements ITeamSystemController.ConnectCommand
            Get
                Return m_ConnectCommand
            End Get
        End Property

        Sub OnConnectExecuted(ByVal server As Uri)
            
        End Sub

        Public Sub TryConnect() Implements Interfaces.ITeamSystemController.TryConnect
            'TODO: Load from saved state
            OnConnectExecuted(New Uri("http://gla1vs10.aggrekonet.biz:8080"))
        End Sub



    End Class

End Namespace